Exemplo n.º 1
0
        public static FieldForceProfile GetFieldForceProfileBySettingKeyName(int fieldForceId, string settingKeyName, string settingKeyDescription)
        {
            FieldForceProfile TheFieldForceProfile;

            try
            {
                List <FieldForceProfile> FieldForceProfileList = GetFieldForceProfileByFieldForceID(fieldForceId);

                if (FieldForceProfileList.Count > 0)
                {
                    TheFieldForceProfile = (from FieldForceProfileTable in FieldForceProfileList
                                            where FieldForceProfileTable.SettingKeyName == settingKeyName && FieldForceProfileTable.SettingKeyDescription == settingKeyDescription
                                            select FieldForceProfileTable).Last();
                }
                else
                {
                    TheFieldForceProfile = new FieldForceProfile();
                }
            }
            catch
            {
                TheFieldForceProfile = new FieldForceProfile();
            }

            return(TheFieldForceProfile);
        }
        public int UpdateFieldForceProfile(FieldForceProfile theFieldForceProfile)
        {
            int ReturnValue = 0;

            using (SqlCommand UpdateCommand = new SqlCommand())
            {
                UpdateCommand.CommandType = CommandType.StoredProcedure;
                UpdateCommand.Parameters.Add(GetParameter("@ReturnValue", SqlDbType.Int, ReturnValue)).Direction = ParameterDirection.Output;
                UpdateCommand.Parameters.Add(GetParameter("@FieldForceProfileID", SqlDbType.Int, theFieldForceProfile.FieldForceProfileID));
                UpdateCommand.Parameters.Add(GetParameter("@FieldForceID", SqlDbType.Int, theFieldForceProfile.FieldForceID));

                UpdateCommand.Parameters.Add(GetParameter("SettingKeyName", SqlDbType.VarChar, theFieldForceProfile.SettingKeyName));
                UpdateCommand.Parameters.Add(GetParameter("SettingKeyDescription", SqlDbType.VarChar, theFieldForceProfile.SettingKeyDescription));
                UpdateCommand.Parameters.Add(GetParameter("SettingKeyValue", SqlDbType.VarBinary, theFieldForceProfile.SettingKeyValue));
                UpdateCommand.Parameters.Add(GetParameter("SettingKeyReference", SqlDbType.VarChar, theFieldForceProfile.SettingKeyReference));

                UpdateCommand.Parameters.Add(GetParameter("@ModifiedBy", SqlDbType.Int, Micro.Commons.Connection.LoggedOnUser.UserID));
                UpdateCommand.CommandText = "pCRM_FieldForceProfiles_Update";

                ExecuteStoredProcedure(UpdateCommand);
                ReturnValue = int.Parse(UpdateCommand.Parameters[0].Value.ToString());
            }

            return(ReturnValue);
        }
Exemplo n.º 3
0
        public static FieldForceProfile GetFieldForceProfileByID(int fieldForceProfileID)
        {
            DataRow FieldForceProfileRow = FieldForceProfileDataAccess.GetInstance.GetFieldForceProfileByID(fieldForceProfileID);

            FieldForceProfile TheFieldForceProfile = DataRowToObject(FieldForceProfileRow);

            return(TheFieldForceProfile);
        }
Exemplo n.º 4
0
        public static List <FieldForceProfile> GetFieldForceProfileByFieldForceID(int fieldForceID)
        {
            List <FieldForceProfile> FieldForceProfileList = new List <FieldForceProfile>();

            DataTable FieldForceProfileTable = FieldForceProfileDataAccess.GetInstance.GetFieldForceProfileByFieldForceID(fieldForceID);

            foreach (DataRow dr in FieldForceProfileTable.Rows)
            {
                FieldForceProfile TheFieldForceProfile = DataRowToObject(dr);

                FieldForceProfileList.Add(TheFieldForceProfile);
            }

            return(FieldForceProfileList);
        }
        public int DeleteFieldForceProfile(FieldForceProfile theFieldForceProfile)
        {
            int ReturnValue = 0;

            SqlCommand DeleteCommand = new SqlCommand();

            DeleteCommand.CommandType = CommandType.StoredProcedure;
            DeleteCommand.Parameters.Add(GetParameter("@ReturnValue", SqlDbType.Int, ReturnValue)).Direction = ParameterDirection.Output;
            DeleteCommand.Parameters.Add(GetParameter("@FieldForceProfileID", SqlDbType.Int, theFieldForceProfile.FieldForceProfileID));
            DeleteCommand.Parameters.Add(GetParameter("@ModifiedBy", SqlDbType.Int, Micro.Commons.Connection.LoggedOnUser.UserID));
            DeleteCommand.CommandText = "pCRM_FieldForceProfiles_Delete";

            ExecuteStoredProcedure(DeleteCommand);
            ReturnValue = int.Parse(DeleteCommand.Parameters[0].Value.ToString());

            return(ReturnValue);
        }
Exemplo n.º 6
0
        public static FieldForceProfile DataRowToObject(DataRow dr)
        {
            FieldForceProfile TheFieldForceProfile = new FieldForceProfile();

            TheFieldForceProfile.FieldForceProfileID   = int.Parse(dr["FieldForceProfileID"].ToString());
            TheFieldForceProfile.FieldForceID          = int.Parse(dr["FieldForceID"].ToString());
            TheFieldForceProfile.FieldForceCode        = dr["FieldForceCode"].ToString();
            TheFieldForceProfile.FieldForceName        = dr["FieldForceName"].ToString();
            TheFieldForceProfile.SettingKeyName        = dr["SettingKeyName"].ToString();
            TheFieldForceProfile.SettingKeyDescription = dr["SettingKeyDescription"].ToString();
            if (!string.IsNullOrEmpty(dr["SettingKeyValue"].ToString()))
            {
                TheFieldForceProfile.SettingKeyValue = (byte[])dr["SettingKeyValue"];
            }
            TheFieldForceProfile.SettingKeyReference = dr["SettingKeyReference"].ToString();

            return(TheFieldForceProfile);
        }
Exemplo n.º 7
0
 public static int InsertFieldForceProfile(FieldForceProfile theFieldForceProfile)
 {
     return(FieldForceProfileDataAccess.GetInstance.InsertFieldForceProfile(theFieldForceProfile));
 }
 public static int UpdateFieldForce(FieldForce theFieldForce, FieldForceProfile thePhoto, FieldForceProfile theSignature)
 {
     return(FieldForceDataAccess.GetInstance.UpdateFieldForce(theFieldForce, thePhoto, theSignature));
 }
Exemplo n.º 9
0
 public int DeleteFieldForceProfile(FieldForceProfile theFieldForceProfile)
 {
     return(FieldForceProfileIntegration.DeleteFieldForceProfile(theFieldForceProfile));
 }
Exemplo n.º 10
0
 public int UpdateFieldForceProfile(FieldForceProfile theFieldForceProfile)
 {
     return(FieldForceProfileIntegration.UpdateFieldForceProfile(theFieldForceProfile));
 }
Exemplo n.º 11
0
 public int InsertFieldForceProfile(FieldForceProfile theFieldForceProfile)
 {
     return(FieldForceProfileIntegration.InsertFieldForceProfile(theFieldForceProfile));
 }
        public int UpdateFieldForce(FieldForce theFieldForce, FieldForceProfile thePhoto, FieldForceProfile theSignature)
        {
            int ReturnValue = 0;

            using (SqlCommand UpdateCommand = new SqlCommand())
            {
                UpdateCommand.CommandType = CommandType.StoredProcedure;
                UpdateCommand.Parameters.Add(GetParameter("@ReturnValue", SqlDbType.Int, ReturnValue)).Direction = ParameterDirection.Output;
                UpdateCommand.Parameters.Add(GetParameter("@FieldForceID", SqlDbType.Int, theFieldForce.FieldForceID));
                UpdateCommand.Parameters.Add(GetParameter("@FieldForceRankID", SqlDbType.Int, theFieldForce.FieldForceRankID));
                UpdateCommand.Parameters.Add(GetParameter("@FieldForceRankDescription", SqlDbType.VarChar, theFieldForce.FieldForceRankDescription));
                UpdateCommand.Parameters.Add(GetParameter("@ReportingToFieldForceID", SqlDbType.Int, theFieldForce.ReportingToFieldForceID));
                UpdateCommand.Parameters.Add(GetParameter("@Salutation", SqlDbType.VarChar, theFieldForce.Salutation));
                UpdateCommand.Parameters.Add(GetParameter("@FieldForceName", SqlDbType.VarChar, theFieldForce.FieldForceName));
                UpdateCommand.Parameters.Add(GetParameter("@FatherName", SqlDbType.VarChar, theFieldForce.FatherName));
                UpdateCommand.Parameters.Add(GetParameter("@HusbandName", SqlDbType.VarChar, theFieldForce.HusbandName));
                UpdateCommand.Parameters.Add(GetParameter("@Gender", SqlDbType.VarChar, theFieldForce.Gender));
                UpdateCommand.Parameters.Add(GetParameter("@MaritalStatus", SqlDbType.VarChar, theFieldForce.MaritalStatus));
                UpdateCommand.Parameters.Add(GetParameter("@DateOfBirth", SqlDbType.VarChar, theFieldForce.DateOfBirth));
                UpdateCommand.Parameters.Add(GetParameter("@Age", SqlDbType.Int, theFieldForce.Age));
                UpdateCommand.Parameters.Add(GetParameter("@Address_Present_TownOrCity", SqlDbType.VarChar, theFieldForce.Address_Present_TownOrCity));
                UpdateCommand.Parameters.Add(GetParameter("@Address_Present_Landmark", SqlDbType.VarChar, theFieldForce.Address_Present_Landmark));
                UpdateCommand.Parameters.Add(GetParameter("@Address_Present_PinCode", SqlDbType.VarChar, theFieldForce.Address_Present_PinCode));
                UpdateCommand.Parameters.Add(GetParameter("@Address_Present_DistrictID", SqlDbType.Int, theFieldForce.Address_Present_DistrictID));
                UpdateCommand.Parameters.Add(GetParameter("@Address_Permanent_TownOrCity", SqlDbType.VarChar, theFieldForce.Address_Permanent_TownOrCity));
                UpdateCommand.Parameters.Add(GetParameter("@Address_Permanent_Landmark", SqlDbType.VarChar, theFieldForce.Address_Permanent_Landmark));
                UpdateCommand.Parameters.Add(GetParameter("@Address_Permanent_PinCode", SqlDbType.VarChar, theFieldForce.Address_Permanent_PinCode));
                UpdateCommand.Parameters.Add(GetParameter("@Address_Permanent_DistrictID", SqlDbType.Int, theFieldForce.Address_Permanent_DistrictID));
                UpdateCommand.Parameters.Add(GetParameter("@PhoneNumber", SqlDbType.VarChar, theFieldForce.PhoneNumber));
                UpdateCommand.Parameters.Add(GetParameter("@Mobile", SqlDbType.VarChar, theFieldForce.Mobile));
                UpdateCommand.Parameters.Add(GetParameter("@EMailID", SqlDbType.VarChar, theFieldForce.EMailID));
                UpdateCommand.Parameters.Add(GetParameter("@FieldForce_Qualification", SqlDbType.VarChar, theFieldForce.FieldForce_Qualification));
                UpdateCommand.Parameters.Add(GetParameter("@Occupation", SqlDbType.VarChar, theFieldForce.Occupation));
                UpdateCommand.Parameters.Add(GetParameter("@Nationality", SqlDbType.VarChar, theFieldForce.Nationality));
                UpdateCommand.Parameters.Add(GetParameter("@Religion", SqlDbType.VarChar, theFieldForce.Religion));
                UpdateCommand.Parameters.Add(GetParameter("@Caste", SqlDbType.VarChar, theFieldForce.Caste));
                UpdateCommand.Parameters.Add(GetParameter("@NomineeName", SqlDbType.VarChar, theFieldForce.NomineeName));
                UpdateCommand.Parameters.Add(GetParameter("@Nominee_Permanent_TownOrCity", SqlDbType.VarChar, theFieldForce.Nominee_Permanent_TownOrCity));
                UpdateCommand.Parameters.Add(GetParameter("@Nominee_Permanent_Landmark", SqlDbType.VarChar, theFieldForce.Nominee_Permanent_Landmark));
                UpdateCommand.Parameters.Add(GetParameter("@Nominee_Permanent_PinCode", SqlDbType.VarChar, theFieldForce.Nominee_Permanent_PinCode));
                UpdateCommand.Parameters.Add(GetParameter("@Nominee_Permanent_DistrictID", SqlDbType.Int, theFieldForce.Nominee_Permanent_DistrictID));
                UpdateCommand.Parameters.Add(GetParameter("@NomineeRelationship", SqlDbType.VarChar, theFieldForce.NomineeRelationship));
                UpdateCommand.Parameters.Add(GetParameter("@NomineeAge", SqlDbType.Int, theFieldForce.NomineeAge));
                UpdateCommand.Parameters.Add(GetParameter("@IsNomineeACoWorker", SqlDbType.Bit, theFieldForce.IsNomineeACoWorker));
                UpdateCommand.Parameters.Add(GetParameter("@Nominee_Qualification", SqlDbType.VarChar, theFieldForce.Nominee_Qualification));
                UpdateCommand.Parameters.Add(GetParameter("@BankBranchID", SqlDbType.Int, theFieldForce.BankBranchID));
                UpdateCommand.Parameters.Add(GetParameter("@BankAccountNumber", SqlDbType.VarChar, theFieldForce.BankAccountNumber));
                UpdateCommand.Parameters.Add(GetParameter("@PhotoKeyName", SqlDbType.VarChar, thePhoto.SettingKeyName));
                UpdateCommand.Parameters.Add(GetParameter("@PhotoKeyDescription", SqlDbType.VarChar, thePhoto.SettingKeyDescription));
                UpdateCommand.Parameters.Add(GetParameter("@PhotoKeyValue", SqlDbType.VarBinary, thePhoto.SettingKeyValue));
                UpdateCommand.Parameters.Add(GetParameter("@PhotoKeyReference", SqlDbType.VarChar, thePhoto.SettingKeyReference));
                UpdateCommand.Parameters.Add(GetParameter("@SignatureKeyName", SqlDbType.VarChar, theSignature.SettingKeyName));
                UpdateCommand.Parameters.Add(GetParameter("@SignatureKeyDescription", SqlDbType.VarChar, theSignature.SettingKeyDescription));
                UpdateCommand.Parameters.Add(GetParameter("@SignatureKeyValue", SqlDbType.VarBinary, theSignature.SettingKeyValue));
                UpdateCommand.Parameters.Add(GetParameter("@SignatureKeyReference", SqlDbType.VarChar, theSignature.SettingKeyReference));
                UpdateCommand.Parameters.Add(GetParameter("@OfficeID", SqlDbType.Int, Micro.Commons.Connection.LoggedOnUser.OfficeID));
                UpdateCommand.Parameters.Add(GetParameter("@ModifiedBy", SqlDbType.Int, Micro.Commons.Connection.LoggedOnUser.UserID));
                UpdateCommand.CommandText = "pCRM_FieldForces_Update";

                ExecuteStoredProcedure(UpdateCommand);

                ReturnValue = int.Parse(UpdateCommand.Parameters[0].Value.ToString());

                return(ReturnValue);
            }
        }
		public int UpdateFieldForce(FieldForce theFieldForce, FieldForceProfile thePhoto, FieldForceProfile theSignature)
		{
			return FieldForceIntegration.UpdateFieldForce(theFieldForce, thePhoto, theSignature);
		}