public static string ModifyProductionOrganization(string myOrganizationId, string myName, string myLevelCode, string myType, string myCommissioningDate, string myAddress, string myContacts, string myLegalRepresentative, string myContactInfo, string myProducts, string myRemark) { if (mUserId != "") { Model.ProductionOrganizationInfo m_ProductionOrganizationInfo = new Model.ProductionOrganizationInfo(); m_ProductionOrganizationInfo.OrganizationID = myOrganizationId; m_ProductionOrganizationInfo.Name = myName; m_ProductionOrganizationInfo.LevelCode = myLevelCode; m_ProductionOrganizationInfo.DatabaseID = ""; m_ProductionOrganizationInfo.Type = myType; m_ProductionOrganizationInfo.CommissioningDate = myCommissioningDate; m_ProductionOrganizationInfo.Address = myAddress; m_ProductionOrganizationInfo.Contacts = myContacts; m_ProductionOrganizationInfo.LegalRepresentative = myLegalRepresentative; m_ProductionOrganizationInfo.ContactInfo = myContactInfo; m_ProductionOrganizationInfo.Products = myProducts; m_ProductionOrganizationInfo.Remarks = myRemark; string m_ProductionOrganizationInfoJson = DataAuthorization.Bll.ProductionAuthorization.ModifyProductionOrganization(m_ProductionOrganizationInfo); return(m_ProductionOrganizationInfoJson); } else { return("非法的用户操作!"); } }
public int AddProductionOrganization(Model.ProductionOrganizationInfo myProductionOrganizationInfo) { string m_Sql = @" Insert into system_Organization ( OrganizationID, LevelCode, Name, Type, LegalRepresentative, Address, Contacts, ContactInfo, CommissioningDate, Products, Remarks) values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}');"; m_Sql = m_Sql.Replace("{0}", myProductionOrganizationInfo.OrganizationID); m_Sql = m_Sql.Replace("{1}", myProductionOrganizationInfo.LevelCode); m_Sql = m_Sql.Replace("{2}", myProductionOrganizationInfo.Name); m_Sql = m_Sql.Replace("{3}", myProductionOrganizationInfo.Type); m_Sql = m_Sql.Replace("{4}", myProductionOrganizationInfo.LegalRepresentative); m_Sql = m_Sql.Replace("{5}", myProductionOrganizationInfo.Address); m_Sql = m_Sql.Replace("{6}", myProductionOrganizationInfo.Contacts); m_Sql = m_Sql.Replace("{7}", myProductionOrganizationInfo.ContactInfo); m_Sql = m_Sql.Replace("{8}", myProductionOrganizationInfo.CommissioningDate); m_Sql = m_Sql.Replace("{9}", myProductionOrganizationInfo.Products); m_Sql = m_Sql.Replace("{10}", myProductionOrganizationInfo.Remarks); try { int m_ReturnValue = m_DbDataAdapter.MySqlDbDataAdaper.ExecuteNonQuery(m_Sql); return(m_ReturnValue >= 1 ? 1 : m_ReturnValue);; } catch (Exception) { return(-1); } }
public static string ModifyProductionOrganization(Model.ProductionOrganizationInfo myProductionOrganizationInfo) { bool m_CheckSameNode = dal_IProductionAuthorization.CheckSameNode(myProductionOrganizationInfo.OrganizationID, myProductionOrganizationInfo.LevelCode, true); if (m_CheckSameNode == true) { return("系统内存在相同层次码的节点!"); } else { int m_ReturnValue = dal_IProductionAuthorization.ModifyProductionOrganization(myProductionOrganizationInfo); return(m_ReturnValue.ToString()); } }
public int ModifyProductionOrganization(Model.ProductionOrganizationInfo myProductionOrganizationInfo) { string m_Sql = @"Update system_Organization set LevelCode = '{1}', Name = '{2}', Type = '{3}', LegalRepresentative = '{4}', Address = '{5}', Contacts = '{6}', ContactInfo = '{7}', CommissioningDate = '{8}', Products = '{9}', Remarks = '{10}' where OrganizationID = '{0}'"; m_Sql = m_Sql.Replace("{0}", myProductionOrganizationInfo.OrganizationID); m_Sql = m_Sql.Replace("{1}", myProductionOrganizationInfo.LevelCode); m_Sql = m_Sql.Replace("{2}", myProductionOrganizationInfo.Name); m_Sql = m_Sql.Replace("{3}", myProductionOrganizationInfo.Type); m_Sql = m_Sql.Replace("{4}", myProductionOrganizationInfo.LegalRepresentative); m_Sql = m_Sql.Replace("{5}", myProductionOrganizationInfo.Address); m_Sql = m_Sql.Replace("{6}", myProductionOrganizationInfo.Contacts); m_Sql = m_Sql.Replace("{7}", myProductionOrganizationInfo.ContactInfo); m_Sql = m_Sql.Replace("{8}", myProductionOrganizationInfo.CommissioningDate); m_Sql = m_Sql.Replace("{9}", myProductionOrganizationInfo.Products); m_Sql = m_Sql.Replace("{10}", myProductionOrganizationInfo.Remarks); try { int ModifyRows = m_DbDataAdapter.MySqlDbDataAdaper.ExecuteNonQuery(m_Sql); return(ModifyRows >= 1 ? 1 : ModifyRows); } catch { return(-1); } }