示例#1
0
 public void SaveResponsibleStaffInfo(ResponsibleStaffInfo responsibleStaffInfo, string clientID)
 {
     if (this.IsResponsibleStaffExisted(clientID, responsibleStaffInfo.StaffID))
     {
         this.UpdateResponsibleStaff(responsibleStaffInfo);
     }
     else
     {
         this.InsertResponsibleStaff(responsibleStaffInfo);
     }
 }
示例#2
0
    public void UpdateResponsibleStaff(ResponsibleStaffInfo responsibleStaffInfo)
    {
        string query =
            "UPDATE [dbo].[ResponsibleStaffList] "
            + "SET  "
            + "[StaffName] = @StaffName "
            + ",[ResponsibilityType] = @ResponsibilityType "
            + ",[LastModifiedUser] = @LastModifiedUser "
            + ",[LastModifiedDate] = @LastModifiedDate "
            + "WHERE ClientID = @ClientID and StaffID = @StaffID  ";

        db.Execute(query, responsibleStaffInfo, transaction);
    }
示例#3
0
    public void InsertResponsibleStaff(ResponsibleStaffInfo responsibleStaffInfo)
    {
        string query = "INSERT INTO [dbo].[ResponsibleStaffList] "
                       + "([ClientID] "
                       + ",[StaffID] "
                       + ",[StaffName] "
                       + ",[ResponsibilityType] "
                       + ",[CreateUser] "
                       + ",[CreateDate] "
                       + ",[LastModifiedUser] "
                       + ",[LastModifiedDate] ) "
                       + "VALUES "
                       + "(@ClientID "
                       + ",@StaffID "
                       + ",@StaffName "
                       + ",@ResponsibilityType "
                       + ",@CreateUser "
                       + ",@CreateDate "
                       + ",@LastModifiedUser "
                       + ",@LastModifiedDate) ";

        db.Execute(query, responsibleStaffInfo, transaction);
    }