private static void SetSalImpFlag(SalService srv, DataSet dsSrc) { DataTable table = dsSrc.Tables["account"]; if (table.Rows.Count > 0) { string accountCodes = ""; for (int i = 0; i < table.Rows.Count; i++) { if (accountCodes != "") { accountCodes = accountCodes + ","; } accountCodes = accountCodes + table.Rows[i]["account_code"].ToString(); } srv.SetSalAccountImpFlag(accountCodes); } if (dsSrc.Tables.Contains("contract")) { DataTable table2 = dsSrc.Tables["contract"]; if ((table2.Rows.Count > 0) && (table2.Rows[0]["jiesuan"].ToString() == "1")) { string contractCodes = table2.Rows[0]["contract_code"].ToString(); srv.SetSalContractImpFlag(contractCodes); } } }
public static string GetSalProjectNameByCode(string ProjectCode) { string text2; try { string text = ""; if (ProjectCode == "") { return(text); } SalService service = new SalService(); DataTable table = service.GetSalProjectByCode(ProjectCode).Tables[0]; if (table.Rows.Count > 0) { text = ConvertRule.ToString(table.Rows[0]["Proj_Name"]); } text2 = text; } catch (Exception exception) { throw exception; } return(text2); }
public static void DtsPaySingleByClient(string ClientCode) { Exception exception; try { SalService srv = new SalService(); DataSet dsSrc = srv.GetSalDataByClient(ClientCode); DataTable table = dsSrc.Tables["Client"]; if (table.Rows.Count > 0) { string projectCode = ProjectRule.GetProjectCodeBySalProjectCode(table.Rows[0]["proj_code"].ToString()); switch (projectCode) { case null: case "": throw new Exception("该客户在项目管理系统中无对应的项目"); } using (StandardEntityDAO dao = new StandardEntityDAO("SalClient")) { dao.BeginTrans(); try { EntityData data = ImportSalClientByClient(ClientCode, projectCode, dsSrc, dao); EntityData data2 = ImportSalContractByClient(ClientCode, projectCode, dsSrc, dao); EntityData data3 = ImportSalPayByClient(ClientCode, projectCode, dsSrc, dao); EntityData data4 = ImportSalPayPlanByClient(ClientCode, projectCode, dsSrc, dao); EntityData data5 = ImportSalPayRelaByClient(ClientCode, projectCode, dsSrc, dao); dao.CommitTrans(); } catch (Exception exception1) { exception = exception1; try { dao.RollBackTrans(); } catch { } throw exception; } SetSalImpFlag(srv, dsSrc); } } } catch (Exception exception2) { exception = exception2; throw exception; } }
public static DataTable GetDtsPayByClient(string ProjectCode, string ClientName) { string projectCode = ""; if ((ProjectCode == null) || (ProjectCode == "")) { projectCode = ProjectRule.GetAllSalProjectCode(); } else { projectCode = ProjectRule.GetSalProjectCode(ProjectCode); } SalService service = new SalService(); return(service.GetSalDataHeadClientByClientName(projectCode, ClientName).Tables[0]); }
public static DataTable GetSalProjectByCode(string ProjectCode) { DataTable table2; try { SalService service = new SalService(); DataTable table = service.GetSalProjectByCode(ProjectCode).Tables[0]; table2 = table; } catch (Exception exception) { throw exception; } return(table2); }