| | |
| | | } |
| | | else |
| | | { |
| | | sql = @"update TOrganization set is_delete='1' where id=@orgid"; |
| | | sql = @"delete TOrganization where id=@orgid"; |
| | | dynamicParams.Add(@"orgid", orgid); |
| | | cont = DapperHelper.SQL(sql, dynamicParams); |
| | | if (cont > 0) |
| | |
| | | } |
| | | if (unitAttr != "" && unitAttr != null) |
| | | { |
| | | switch (unitAttr) |
| | | { |
| | | case "WG": //外购 |
| | | search += "and A.mtype=@unitAttr "; |
| | | dynamicParams.Add("@unitAttr", unitAttr); |
| | | break; |
| | | case "WX": //外协 |
| | | search += "and A.btype=@unitAttr "; |
| | | dynamicParams.Add("@unitAttr", unitAttr); |
| | | break; |
| | | default: //客户 |
| | | search += "and A.htype=@unitAttr "; |
| | | dynamicParams.Add("@unitAttr", unitAttr); |
| | | break; |
| | | } |
| | | search += "and A.type=@unitAttr "; |
| | | dynamicParams.Add("@unitAttr", unitAttr); |
| | | } |
| | | if (createUser != "" && createUser != null) |
| | | { |
| | |
| | | } |
| | | // --------------查询指定数据-------------- |
| | | var total = 0; //总条数 |
| | | var sql = @"select A.id,A.code,A.name,A.mtype,A.btype,A.htype,A.conttacts,A.conttphone,A.addr,T.username as lm_user,A.lm_date from TCustomer A |
| | | var sql = @"select A.id,A.code,A.name,A.type,A.conttacts,A.conttphone,A.addr,T.username as lm_user,A.lm_date from TCustomer A |
| | | left join TUser T on A.lm_user=T.usercode |
| | | where A.is_delete<>'1' " + search; |
| | | var data = DapperHelper.GetPageList<object>(sql, dynamicParams, prop, order, startNum, endNum, out total); |
| | |
| | | #endregion |
| | | |
| | | #region[往来单位新增编辑] |
| | | public static ToMessage AddUpdateCurrentUnit(string unitid, string unitcode, string unitname, string mtypecode, string btypecode, string htypecode, string person, string contact, string description, string usercode, string OperType) |
| | | public static ToMessage AddUpdateCurrentUnit(string unitid, string unitcode, string unitname, string typecode, string person, string contact, string description, string usercode, string OperType) |
| | | { |
| | | var dynamicParams = new DynamicParameters(); |
| | | try |
| | |
| | | mes.data = null; |
| | | return mes; |
| | | } |
| | | var sql = @"insert into TCustomer(code,name,mtype,btype,htype,conttacts,conttphone,addr,lm_user,lm_date) |
| | | values(@unitcode,@unitname,@mtypecode,@btypecode,@htypecode,@person,@contact,@description,@usercode,@CreateDate)"; |
| | | var sql = @"insert into TCustomer(code,name,type,conttacts,conttphone,addr,lm_user,lm_date) |
| | | values(@unitcode,@unitname,@typecode,@person,@contact,@description,@usercode,@CreateDate)"; |
| | | dynamicParams.Add("@unitcode", unitcode); |
| | | dynamicParams.Add("@unitname", unitname); |
| | | dynamicParams.Add("@mtypecode", mtypecode); |
| | | dynamicParams.Add("@btypecode", btypecode); |
| | | dynamicParams.Add("@htypecode", htypecode); |
| | | dynamicParams.Add("@typecode", typecode); |
| | | dynamicParams.Add("@person", person); |
| | | dynamicParams.Add("@contact", contact); |
| | | dynamicParams.Add("@description", description); |
| | |
| | | } |
| | | if (OperType == "Update") |
| | | { |
| | | var sql = @"update TCustomer set name=@unitname,mtype=@mtypecode,btype=@btypecode,htype=@htypecode,conttacts=@person,conttphone=@contact,addr=@description,lm_user=@usercode,lm_date=@CreateDate where id=@unitid"; |
| | | var sql = @"update TCustomer set name=@unitname,type=@typecode,conttacts=@person,conttphone=@contact,addr=@description,lm_user=@usercode,lm_date=@CreateDate where id=@unitid"; |
| | | dynamicParams.Add("@unitid", unitid); |
| | | dynamicParams.Add("@unitname", unitname); |
| | | dynamicParams.Add("@mtypecode", mtypecode); |
| | | dynamicParams.Add("@btypecode", btypecode); |
| | | dynamicParams.Add("@htypecode", htypecode); |
| | | dynamicParams.Add("@typecode", typecode); |
| | | dynamicParams.Add("@person", person); |
| | | dynamicParams.Add("@contact", contact); |
| | | dynamicParams.Add("@description", description); |