| | |
| | | //导入往来单位表 |
| | | for (int i = 0; i < excelTable.Rows.Count; i++) |
| | | { |
| | | string WGType = "", WXType = "", KHType = ""; |
| | | string Type = ""; |
| | | switch (excelTable.Rows[i][3].ToString().Trim()) |
| | | { |
| | | case "外购供方": |
| | | WGType = "WG"; |
| | | break; |
| | | case "外协供方": |
| | | WXType = "WX"; |
| | | case "供应商": |
| | | Type = "226"; |
| | | break; |
| | | case "客户": |
| | | KHType = "KH"; |
| | | Type = "211"; |
| | | break; |
| | | case "客户/供应商": |
| | | Type = "228"; |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | |
| | | sql = @"insert into TCustomer(code,name,mtype,conttacts,conttphone,addr,lm_user,lm_date,btype,htype) |
| | | values(@code,@name,@mtype,@conttacts,@conttphone,@addr,@Operator,@CreateDate,@btype,@htype)"; |
| | | sql = @"insert into TCustomer(code,name,type,conttacts,conttphone,addr,lm_user,lm_date) |
| | | values(@code,@name,@type,@conttacts,@conttphone,@addr,@Operator,@CreateDate)"; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | |
| | | { |
| | | code = excelTable.Rows[i][1].ToString().Trim(), |
| | | name = excelTable.Rows[i][2].ToString().Trim(), |
| | | mtype = WGType, |
| | | type = Type, |
| | | conttacts = excelTable.Rows[i][4].ToString().Trim(), |
| | | conttphone = excelTable.Rows[i][5].ToString().Trim(), |
| | | addr = excelTable.Rows[i][6].ToString().Trim(), |
| | | Operator = User, |
| | | CreateDate = DateTime.Now.ToString(), |
| | | btype = WXType, |
| | | htype = KHType |
| | | CreateDate = DateTime.Now.ToString() |
| | | } |
| | | }); |
| | | } |