本文整理汇总了C#中Common.Model类的典型用法代码示例。如果您正苦于以下问题:C# Model类的具体用法?C# Model怎么用?C# Model使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Model类属于Common命名空间,在下文中一共展示了Model类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeleteRecord
public bool DeleteRecord(Model.IModel.IModelObject KeyObject)
{
Sys_FunctionMaster_fum_Info info = null;
try
{
info = KeyObject as Sys_FunctionMaster_fum_Info;
using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
{
Sys_FunctionMaster_fum fum = db.Sys_FunctionMaster_fum.Single<Sys_FunctionMaster_fum>(i => i.fum_iRecordID == info.fum_iRecordID);
//for (int i = 0; i < fum.Sys_FormPurview_frps.Count; i++)
//{
// Sys_FormPurview_frp sta = fum.Sys_FormPurview_frps[i];
// db.Sys_FormPurview_frps.DeleteOnSubmit(sta);
//}
db.Sys_FunctionMaster_fum.DeleteOnSubmit(fum);
db.SubmitChanges();
return true;
}
}
catch (Exception Ex)
{
throw Ex;
}
}
示例2: Save
public Model.General.ReturnValueInfo Save(Model.IModel.IModelObject itemEntity, Common.DefineConstantValue.EditStateEnum EditMode)
{
ReturnValueInfo rvInfo = new ReturnValueInfo();
try
{
BlacklistChangeRecord_blc_Info recordInfo = itemEntity as BlacklistChangeRecord_blc_Info;
if (recordInfo == null)
{
rvInfo.isError = true;
rvInfo.messageText = Common.DefineConstantValue.SystemMessageText.strMessageText_E_ObjectNull;
return rvInfo;
}
switch (EditMode)
{
case Common.DefineConstantValue.EditStateEnum.OE_Insert:
return this._IBlacklistChangeRecordDA.InsertRecord(recordInfo);
break;
case Common.DefineConstantValue.EditStateEnum.OE_Update:
return this._IBlacklistChangeRecordDA.UpdateRecord(recordInfo);
break;
case Common.DefineConstantValue.EditStateEnum.OE_Delete:
return this._IBlacklistChangeRecordDA.DeleteRecord(recordInfo);
break;
default:
break;
}
}
catch (Exception ex)
{
rvInfo.messageText = ex.Message;
rvInfo.isError = true;
}
return rvInfo;
}
示例3: LoginBehalf
/// <summary>
/// 登记代表
/// </summary>
/// <param name="user"></param>
public void LoginBehalf(Model.T_Behalf user)
{
HttpContext.Current.Session["UserName"] = user.UserName;
HttpContext.Current.Session["Phone"] = user.Phone;
HttpContext.Current.Session["Id"] = user.Id;
HttpContext.Current.Session["IsVoted"] = user.IsVoted;
}
示例4: Add
/// <summary>
/// 增加一条数据
/// </summary>
public string Add(Model.QQ_Layer model)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("insert into QQ_Layer(");
strSql.Append("qq_code,qq_alt,qq_paixu,qq_createdate,qq_state,qq_delete)");
strSql.Append(" values (");
strSql.Append("@qq_code,@qq_alt,@qq_paixu,@qq_createdate,@qq_state,@qq_delete)");
strSql.Append(";select @@IDENTITY");
SqlParameter[] parameters = {
new SqlParameter("@qq_code", SqlDbType.NVarChar,50),
new SqlParameter("@qq_alt", SqlDbType.NVarChar,100),
new SqlParameter("@qq_paixu", SqlDbType.Int,4),
new SqlParameter("@qq_createdate", SqlDbType.DateTime),
new SqlParameter("@qq_state", SqlDbType.Int,4),
new SqlParameter("@qq_delete", SqlDbType.Int,4)};
parameters[0].Value = model.qq_code;
parameters[1].Value = model.qq_alt;
parameters[2].Value = model.qq_paixu;
parameters[3].Value = model.qq_createdate;
parameters[4].Value = model.qq_state;
parameters[5].Value = model.qq_delete;
int obj = SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionStringLocalTransaction,CommandType.Text, strSql.ToString(), parameters);
if (obj == 1)
{
return "succeeded";
}
else
{
return "error";
}
}
示例5: DeleteRecord
public bool DeleteRecord(Model.IModel.IModelObject KeyObject)
{
Sys_RoleMaster_rlm_Info info = null;
try
{
info = KeyObject as Sys_RoleMaster_rlm_Info;
using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
{
Sys_RoleMaster_rlm rlm = db.Sys_RoleMaster_rlm.Single<Sys_RoleMaster_rlm>(i => i.rlm_iRecordID == info.rlm_iRecordID);
for (int i = 0; i < rlm.Sys_UserRoles_usr.Count; i++)
{
Sys_UserRoles_usr sta = rlm.Sys_UserRoles_usr[i];
db.Sys_UserRoles_usr.DeleteOnSubmit(sta);
}
db.Sys_RoleMaster_rlm.DeleteOnSubmit(rlm);
db.SubmitChanges();
return true;
}
}
catch (Exception Ex)
{
throw Ex;
}
}
示例6: DisplayRecord
public Model.SysMaster.Sys_UserMaster_usm_Info DisplayRecord(Model.IModel.IModelObject KeyObject)
{
Sys_UserMaster_usm_Info usm = new Sys_UserMaster_usm_Info();
Sys_UserMaster_usm_Info info = new Sys_UserMaster_usm_Info();
usm = KeyObject as Sys_UserMaster_usm_Info;
try
{
using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
{
IQueryable<Sys_UserMaster_usm> taQuery =
(from ta in db.Sys_UserMaster_usm
where ta.usm_iRecordID == usm.usm_iRecordID
select ta).Take(1);
if (taQuery != null)
{
foreach (Sys_UserMaster_usm t in taQuery)
{
info = Common.General.CopyObjectValue<Sys_UserMaster_usm, Sys_UserMaster_usm_Info>(t);
FindUserRole(info);
}
}
return info;
}
}
catch (Exception Ex)
{
throw Ex;
}
}
示例7: update
public int update(Model.News mn)
{
StringBuilder sql= new StringBuilder();
sql.Append(" update news set ");
sql.Append(" [email protected], [email protected], [email protected],[email protected],[email protected],[email protected],[email protected],[email protected] ");
sql.Append(" where [email protected] ");
SqlParameter [] par={
new SqlParameter( "@name",SqlDbType.VarChar,50) ,
new SqlParameter("@source",SqlDbType.VarChar,50),
new SqlParameter("@author",SqlDbType.VarChar,50),
new SqlParameter("@hot",SqlDbType.Int,4),
new SqlParameter("@count",SqlDbType.Int,4),
new SqlParameter("@info",SqlDbType.VarChar,0),
new SqlParameter("@nid",SqlDbType.Int,4),
new SqlParameter("@pic",SqlDbType.Int,4 ),
new SqlParameter("@id", SqlDbType.Int,4)
};
par[0].Value = mn.Title;
par[1].Value = mn.From;
par[2].Value = mn.Author;
par[3].Value = mn.Top;
par[4].Value = mn.Click;
par[5].Value = mn.Content;
par[6].Value = mn.Cateid;
par[7].Value = mn.Ispic;
par[8].Value = mn.ID;
int result = DbHelperSQL.ExecuteSql(sql.ToString(),par);
return result;
}
示例8: DisplayRecord
public Sys_FunctionMaster_fum_Info DisplayRecord(Model.IModel.IModelObject KeyObject)
{
Sys_FunctionMaster_fum_Info fum = new Sys_FunctionMaster_fum_Info();
Sys_FunctionMaster_fum_Info info = new Sys_FunctionMaster_fum_Info();
fum = KeyObject as Sys_FunctionMaster_fum_Info;
try
{
using (MainDBDataContext db = new MainDBDataContext())
{
IQueryable<Sys_FunctionMaster_fum> taQuery =
(from ta in db.Sys_FunctionMaster_fum
where ta.fum_iRecordID == fum.fum_iRecordID
//orderby dpms.dpm_iRecordID ascending
select ta).Take(1);
if (taQuery != null)
{
//foreach (var t in taQuery)
foreach (Sys_FunctionMaster_fum t in taQuery)
{
info = Common.General.CopyObjectValue<Sys_FunctionMaster_fum, Sys_FunctionMaster_fum_Info>(t);
FindFormPurview(info);
}
}
return info;
}
}
catch (Exception Ex)
{
throw Ex;
}
}
示例9: add
public int add(Model.News mn)
{
StringBuilder sql = new StringBuilder();
sql.Append(" insert into news ");
sql.Append(" (_title,_from,_author,_top,_click,_content,_cateid,_ispic) ");
sql.Append(" values( @title,@from,@author,@top,@click,@content,@cateid,@ispic ) ");
SqlParameter[] par = { new SqlParameter( "@title",SqlDbType.VarChar,50 ),
new SqlParameter("@from",SqlDbType.VarChar,50),
new SqlParameter("@author",SqlDbType.VarChar,50),
new SqlParameter("@top",SqlDbType.VarChar,50),
new SqlParameter("@click",SqlDbType.VarChar,50),
new SqlParameter("@content",SqlDbType.VarChar,0),
new SqlParameter("@cateid",SqlDbType.VarChar,50),
new SqlParameter("@ispic",SqlDbType.VarChar,50)
};
par[0].Value = mn.Title;
par[1].Value = mn.From;
par[2].Value = mn.Author;
par[3].Value = mn.Top;
par[4].Value = mn.Click;
par[5].Value = mn.Content;
par[6].Value = mn.Cateid;
par[7].Value = mn.Ispic;
int result = DbHelperSQL.ExecuteSql(sql.ToString(),par);
return result;
}
示例10: DisplayRecord
public Sys_FormMaster_fom_Info DisplayRecord(Model.IModel.IModelObject KeyObject)
{
Sys_FormMaster_fom_Info frm = new Sys_FormMaster_fom_Info();
Sys_FormMaster_fom_Info info = null;
frm = KeyObject as Sys_FormMaster_fom_Info;
try
{
using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
{
IQueryable<Sys_FormMaster_fom> taQuery =
(from ta in db.Sys_FormMaster_fom
where ta.fom_iRecordID == frm.fom_iRecordID
select ta).Take(1);
if (taQuery != null)
{
foreach (Sys_FormMaster_fom t in taQuery)
{
info = Common.General.CopyObjectValue<Sys_FormMaster_fom, Sys_FormMaster_fom_Info>(t);
FindFormPurview(info);
}
}
return info;
}
}
catch (Exception Ex)
{
throw Ex;
}
}
示例11: DisplayRecord
public Sys_RoleMaster_rlm_Info DisplayRecord(Model.IModel.IModelObject KeyObject)
{
Sys_RoleMaster_rlm_Info rlm = new Sys_RoleMaster_rlm_Info();
Sys_RoleMaster_rlm_Info info = new Sys_RoleMaster_rlm_Info();
rlm = KeyObject as Sys_RoleMaster_rlm_Info;
try
{
using (SIOTSDB_HHZXDataContext db = new SIOTSDB_HHZXDataContext())
{
IQueryable<Sys_RoleMaster_rlm> taQuery =
(from ta in db.Sys_RoleMaster_rlm
where ta.rlm_iRecordID == rlm.rlm_iRecordID
//orderby dpms.dpm_iRecordID ascending
select ta).Take(1);
if (taQuery != null)
{
//foreach (var t in taQuery)
foreach (Sys_RoleMaster_rlm t in taQuery)
{
info = Common.General.CopyObjectValue<Sys_RoleMaster_rlm, Sys_RoleMaster_rlm_Info>(t);
FindUserRole(info);
}
}
return info;
}
}
catch (Exception Ex)
{
throw Ex;
}
}
示例12: _delete
public int _delete(Model.News mn)
{
StringBuilder sql = new StringBuilder();
sql.Append(" delete from news where [email protected] ");
SqlParameter[] par = { new SqlParameter("@nid", SqlDbType.Int, 4) };
par[0].Value = mn.ID;
int result = DbHelperSQL.ExecuteSql(sql.ToString(),par);
return result;
}
示例13: sqldatareader
public SqlDataReader sqldatareader(Model.Helpcate mh)
{
StringBuilder sql = new StringBuilder();
sql.Append("select * from helpcate");
sql.Append(" where _cateid = @id");
SqlParameter[] par = { new SqlParameter("@id", SqlDbType.Int, 4) };
par[0].Value = mh.ID;
SqlDataReader sdr = Common.DbHelperSQL.ExecuteReader(sql.ToString(), par);
return sdr;
}
示例14: _delete
public int _delete(Model.Helpcate mh)
{
StringBuilder sql = new StringBuilder();
sql.Append(" delete from helpcate ");
sql.Append(" where [email protected] ");
SqlParameter [] par={ new SqlParameter("@id",SqlDbType.Int,4) };
par[0].Value = mh.ID;
int result= Common.DbHelperSQL.ExecuteSql(sql.ToString(),par);
return result;
}
示例15: _delete
public int _delete(Model.downlist md)
{
StringBuilder sql = new StringBuilder();
sql.Append(" delete from downlist ");
sql.Append(" where [email protected] ");
SqlParameter[] par ={ new SqlParameter ("@id",SqlDbType.Int,4)
};
par[0].Value = md.id;
return DbHelperSQL.ExecuteSql(sql.ToString(),par);
}