private void SaveDailySalesCall() { IDailySalesCall dailySales = new DailySalesCallEntity(); BuildDailySalesEntity(dailySales); if (ValidateSave(dailySales)) { List <ICommitment> commitments = ViewState["CommittmentDetails"] as List <ICommitment>; objDailySalesCall = new DailySalesCallBLL(); objDailySalesCall.SaveDailySalesCallEntry(dailySales, commitments); ScriptManager.RegisterStartupScript(this, typeof(Page), "alert", "<script>javascript:void alert('" + ResourceManager.GetStringWithoutName("ERR00005") + "');</script>", false); } }
public static IDailySalesCall GetDailySalesCallEntry(int callId) { string strExecution = "[common].[uspGetDailySalesCall]"; IDailySalesCall salesCall = null; using (DbQuery oDq = new DbQuery(strExecution)) { oDq.AddIntegerParam("@CallId", callId); DataTableReader reader = oDq.GetTableReader(); while (reader.Read()) { salesCall = new DailySalesCallEntity(reader); } reader.Close(); } return(salesCall); }
public static IDailySalesCall GetSalesExecutiveByCallId(int callId) { string strExecution = "[common].[uspGetSalesExecutiveByCallId]"; IDailySalesCall salesCall = null; using (DbQuery oDq = new DbQuery(strExecution)) { oDq.AddIntegerParam("@CallId", callId); DataTableReader reader = oDq.GetTableReader(); while (reader.Read()) { salesCall = new DailySalesCallEntity(); salesCall.UserName = Convert.ToString(reader["UserName"]); } reader.Close(); } return(salesCall); }
//public static List<ICommitment> GetCommitment() //{ // string strExecution = "[common].[uspGetCommitment]"; // List<ICommitment> lstCommitment = new List<ICommitment>(); // using (DbQuery oDq = new DbQuery(strExecution)) // { // DataTableReader reader = oDq.GetTableReader(); // while (reader.Read()) // { // ICommitment commitment = new CommitmentEntity(reader); // lstCommitment.Add(commitment); // } // reader.Close(); // } // return lstCommitment; //} //public static ICommitment GetCommitment(int areaId) //{ // string strExecution = "[common].[uspGetCommitment]"; // ICommitment commitment = null; // using (DbQuery oDq = new DbQuery(strExecution)) // { // oDq.AddIntegerParam("@CommitmentId", areaId); // DataTableReader reader = oDq.GetTableReader(); // while (reader.Read()) // { // commitment = new CommitmentEntity(reader); // } // reader.Close(); // } // return commitment; //} //public static void SaveCommitment(ICommitment commitment, int modifiedBy) //{ // string strExecution = "[common].[uspSaveCommitment]"; // using (DbQuery oDq = new DbQuery(strExecution)) // { // oDq.AddIntegerParam("@CallId", commitment.CallId); // oDq.AddIntegerParam("@WeekNo", commitment.WeekNo); // oDq.AddIntegerParam("@PortId", commitment.PortId); // oDq.AddIntegerParam("@TEU", commitment.TEU); // oDq.AddIntegerParam("@FEU", commitment.FEU); // oDq.AddIntegerParam("@ModifiedBy", modifiedBy); // oDq.RunActionQuery(); // } //} #endregion #region Sales Call public static List <IDailySalesCall> GetDailySalesCallList(int userId) { string strExecution = "[common].[uspGetDailySalesCallList]"; List <IDailySalesCall> lstDSR = new List <IDailySalesCall>(); using (DbQuery oDq = new DbQuery(strExecution)) { oDq.AddIntegerParam("@UserId", userId); DataTableReader reader = oDq.GetTableReader(); while (reader.Read()) { IDailySalesCall dsr = new DailySalesCallEntity(reader); lstDSR.Add(dsr); } reader.Close(); } return(lstDSR); }