public int DragEvents(Event oEvent) { int iRowAffected = 0; try { cmd = new SqlCommand("Drag_Event", con); cmd.Parameters.AddWithValue("@eventID", SqlDbType.BigInt).Value = oEvent.eventID; cmd.Parameters.AddWithValue("@startYear", SqlDbType.VarChar).Value = oEvent.startYear; cmd.Parameters.AddWithValue("@startMonth", SqlDbType.VarChar).Value = oEvent.startMonth; cmd.Parameters.AddWithValue("@startDay", SqlDbType.VarChar).Value = oEvent.startDay; cmd.CommandType = CommandType.StoredProcedure; try { con.Open(); iRowAffected = cmd.ExecuteNonQuery(); } catch (Exception oException) { throw oException; } finally { con.Close(); cmd.Dispose(); } } catch (Exception ex) { throw ex; } return iRowAffected; }
public static bool SaveEvent(Event eventdata) { int r=0; if (eventdata != null) { EventBLL oEventBLL = new EventBLL(); r= oEventBLL.InsertEvents(eventdata); } if(r>0) return true; else return false; }
public static Event[] ViewDetails(int evid) { DataTable dt = new DataTable(); List<Event> details = new List<Event>(); EventBLL oEventBLL = new EventBLL(); dt = oEventBLL.GetEventDetails(evid); foreach (DataRow dtrow in dt.Rows) { Event eve = new Event(); eve.eventID = Int32.Parse(dtrow["eventID"].ToString()); eve.otherInfo = dtrow["otherInfo"].ToString(); eve.backgroundColor = dtrow["backgroundColor"].ToString(); details.Add(eve); } return details.ToArray(); }
public int InsertFile(Event oEvent) { int iRowAffected = 0; cmd = new SqlCommand("SP_ADD_FileData", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@PLT", SqlDbType.VarChar).Value = oEvent.PLT; cmd.Parameters.AddWithValue("@DEPT", SqlDbType.VarChar).Value = oEvent.DEPT; cmd.Parameters.AddWithValue("@MACH", SqlDbType.VarChar).Value = oEvent.MACH; cmd.Parameters.AddWithValue("@YEARX", SqlDbType.VarChar).Value = oEvent.YEARX; cmd.Parameters.AddWithValue("@NUMX", SqlDbType.VarChar).Value = oEvent.NUMX; cmd.Parameters.AddWithValue("@UPC", SqlDbType.VarChar).Value = oEvent.UPC; cmd.Parameters.AddWithValue("@PDTNM", SqlDbType.VarChar).Value = oEvent.PDTNM; cmd.Parameters.AddWithValue("@PPDT3", SqlDbType.VarChar).Value = oEvent.PPDT3; cmd.Parameters.AddWithValue("@PPDT4", SqlDbType.VarChar).Value = oEvent.PPDT4; cmd.Parameters.AddWithValue("@PPDT5", SqlDbType.VarChar).Value = oEvent.PPDT5; cmd.Parameters.AddWithValue("@ORDER#", SqlDbType.VarChar).Value = oEvent.ORDER; cmd.Parameters.AddWithValue("@RO", SqlDbType.VarChar).Value = oEvent.RO; cmd.Parameters.AddWithValue("@REPQTY", SqlDbType.VarChar).Value = oEvent.REPQTY; cmd.Parameters.AddWithValue("@SCHQTY", SqlDbType.VarChar).Value = oEvent.SCHQTY; cmd.Parameters.AddWithValue("@DLVQTY", SqlDbType.VarChar).Value = oEvent.DLVQTY; cmd.Parameters.AddWithValue("@AVGQTY", SqlDbType.VarChar).Value = oEvent.AVGQTY; cmd.Parameters.AddWithValue("@STDATE", SqlDbType.VarChar).Value = oEvent.STDATE; cmd.Parameters.AddWithValue("@TMDATE", SqlDbType.VarChar).Value = oEvent.TMDATE; cmd.Parameters.AddWithValue("@DLDATE", SqlDbType.VarChar).Value = oEvent.DLDATE; cmd.Parameters.AddWithValue("@LWDATE", SqlDbType.VarChar).Value = oEvent.LWDATE; cmd.Parameters.AddWithValue("@ENDATE", SqlDbType.VarChar).Value = oEvent.ENDATE; cmd.Parameters.AddWithValue("@MCHTYP", SqlDbType.VarChar).Value = oEvent.MCHTYP; cmd.Parameters.AddWithValue("@SRMK1", SqlDbType.VarChar).Value = oEvent.SRMK1; cmd.Parameters.AddWithValue("@SRMK2", SqlDbType.VarChar).Value = oEvent.SRMK2; cmd.Parameters.AddWithValue("@SRMK3", SqlDbType.VarChar).Value = oEvent.SRMK3; cmd.Parameters.AddWithValue("@SRMK4", SqlDbType.VarChar).Value = oEvent.SRMK4; cmd.Parameters.AddWithValue("@SRMK5", SqlDbType.VarChar).Value = oEvent.SRMK5; cmd.Parameters.AddWithValue("@EOQ", SqlDbType.VarChar).Value = oEvent.EOQ; cmd.Parameters.AddWithValue("@ROP", SqlDbType.VarChar).Value = oEvent.ROP; cmd.Parameters.AddWithValue("@TOTBK", SqlDbType.VarChar).Value = oEvent.TOTBK; cmd.Parameters.AddWithValue("@ACTAL", SqlDbType.VarChar).Value = oEvent.ACTAL; cmd.Parameters.AddWithValue("@AVGSHP", SqlDbType.VarChar).Value = oEvent.AVGSHP; cmd.Parameters.AddWithValue("@INST1", SqlDbType.VarChar).Value = oEvent.INST1; cmd.Parameters.AddWithValue("@INST2", SqlDbType.VarChar).Value = oEvent.INST2; cmd.Parameters.AddWithValue("@INST3", SqlDbType.VarChar).Value = oEvent.INST3; cmd.Parameters.AddWithValue("@SEQ#", SqlDbType.VarChar).Value = oEvent.SEQ; cmd.Parameters.AddWithValue("@CTRMID", SqlDbType.VarChar).Value = oEvent.CTRMID; cmd.Parameters.AddWithValue("@CUSRID", SqlDbType.VarChar).Value = oEvent.CUSRID; cmd.Parameters.AddWithValue("@CCHGDT", SqlDbType.VarChar).Value = oEvent.CCHGDT; cmd.Parameters.AddWithValue("@CCHGTM", SqlDbType.VarChar).Value = oEvent.CCHGTM; cmd.Parameters.AddWithValue("@CSTS", SqlDbType.VarChar).Value = oEvent.CSTS; cmd.Parameters.AddWithValue("@eventID", SqlDbType.VarChar).Value = oEvent.eventID; try { con.Open(); iRowAffected=cmd.ExecuteNonQuery(); } catch (Exception oException) { throw oException; } finally { con.Close(); cmd.Dispose(); } return iRowAffected; }
public int InsertEvents(Event oEvent) { int iRowAffected = 0; cmd = new SqlCommand("Add_Event", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@eventName", SqlDbType.VarChar).Value = oEvent.eventName; cmd.Parameters.AddWithValue("@startYear", SqlDbType.VarChar).Value = oEvent.startYear; cmd.Parameters.AddWithValue("@startMonth", SqlDbType.VarChar).Value = oEvent.startMonth; cmd.Parameters.AddWithValue("@startDay", SqlDbType.VarChar).Value = oEvent.startDay; cmd.Parameters.AddWithValue("@endYear", SqlDbType.VarChar).Value = oEvent.endYear; cmd.Parameters.AddWithValue("@endMonth", SqlDbType.VarChar).Value = oEvent.endMonth; cmd.Parameters.AddWithValue("@endDay", SqlDbType.VarChar).Value = oEvent.endDay; cmd.Parameters.AddWithValue("@startHour", SqlDbType.VarChar).Value = oEvent.startHour; cmd.Parameters.AddWithValue("@startMin", SqlDbType.VarChar).Value = oEvent.startMin; cmd.Parameters.AddWithValue("@endHour", SqlDbType.VarChar).Value = oEvent.endHour; cmd.Parameters.AddWithValue("@endMin", SqlDbType.VarChar).Value = oEvent.endMin; cmd.Parameters.AddWithValue("@OtherInfo", SqlDbType.VarChar).Value = oEvent.otherInfo; cmd.Parameters.AddWithValue("@backgroundColor", SqlDbType.VarChar).Value = oEvent.backgroundColor; cmd.Parameters.AddWithValue("@foregroundColor", SqlDbType.VarChar).Value = oEvent.foregroundColor; cmd.Parameters.AddWithValue("@eventID", SqlDbType.Int).Direction = ParameterDirection.Output; try { con.Open(); cmd.ExecuteNonQuery(); iRowAffected = Convert.ToInt32(cmd.Parameters["@eventID"].Value); } catch (Exception oException) { throw oException; } finally { con.Close(); cmd.Dispose(); } return iRowAffected; }
public int InsertFile(Event oEvent) { EventDLL oEventDLL = new EventDLL(); return oEventDLL.InsertFile(oEvent); }
public int DragEvents(Event oEvent) { EventDLL oEventDLL = new EventDLL(); return oEventDLL.DragEvents(oEvent); }
protected void btnSave1_Click(object sender, EventArgs e) { try { foreach (RepeaterItem rpItem in rpUpload.Items) { Label lblPLT = rpItem.FindControl("lblPLT") as Label; Label lblDEPT = rpItem.FindControl("lblDEPT") as Label; Label lblMACH = rpItem.FindControl("lblMACH") as Label; Label lblYEARX = rpItem.FindControl("lblYEARX") as Label; Label lblNUMX = rpItem.FindControl("lblNUMX") as Label; Label lblUPC = rpItem.FindControl("lblUPC") as Label; Label lblPDTNM = rpItem.FindControl("lblPDTNM") as Label; Label lblPPDT3 = rpItem.FindControl("lblPPDT3") as Label; Label lblPPDT4 = rpItem.FindControl("lblPPDT4") as Label; Label lblPPDT5 = rpItem.FindControl("lblPPDT5") as Label; Label lblORDER = rpItem.FindControl("lblORDER") as Label; Label lblRO = rpItem.FindControl("lblRO") as Label; Label lblREPQTY = rpItem.FindControl("lblREPQTY") as Label; Label lblSCHQTY = rpItem.FindControl("lblSCHQTY") as Label; Label lblDLVQTY = rpItem.FindControl("lblDLVQTY") as Label; Label lblAVGQTY = rpItem.FindControl("lblAVGQTY") as Label; Label lblSTDATE = rpItem.FindControl("lblSTDATE") as Label; Label lblTMDATE = rpItem.FindControl("lblTMDATE") as Label; Label lblDLDATE = rpItem.FindControl("lblDLDATE") as Label; Label lblLWDATE = rpItem.FindControl("lblLWDATE") as Label; Label lblENDATE = rpItem.FindControl("lblENDATE") as Label; Label lblMCHTYP = rpItem.FindControl("lblMCHTYP") as Label; Label lblSRMK1 = rpItem.FindControl("lblSRMK1") as Label; Label lblSRMK2 = rpItem.FindControl("lblSRMK2") as Label; Label lblSRMK3 = rpItem.FindControl("lblSRMK3") as Label; Label lblSRMK4 = rpItem.FindControl("lblSRMK4") as Label; Label lblSRMK5 = rpItem.FindControl("lblSRMK5") as Label; Label lblEOQ = rpItem.FindControl("lblEOQ") as Label; Label lblROP = rpItem.FindControl("lblROP") as Label; Label lblTOTBK = rpItem.FindControl("lblTOTBK") as Label; Label lblACTAL = rpItem.FindControl("lblACTAL") as Label; Label lblAVGSHP = rpItem.FindControl("lblAVGSHP") as Label; Label lblINST1 = rpItem.FindControl("lblINST1") as Label; Label lblINST2 = rpItem.FindControl("lblINST2") as Label; Label lblINST3 = rpItem.FindControl("lblINST3") as Label; Label lblSEQ = rpItem.FindControl("lblSEQ") as Label; Label lblCTRMID = rpItem.FindControl("lblCTRMID") as Label; Label lblCUSRID = rpItem.FindControl("lblCUSRID") as Label; Label lblCCHGDT = rpItem.FindControl("lblCCHGDT") as Label; Label lblCCHGTM = rpItem.FindControl("lblCCHGTM") as Label; Label lblCSTS = rpItem.FindControl("lblCSTS") as Label; if (lblTMDATE.CssClass != "error") { int sd, sm, sy, ed, em, ey; int shh, smm, sss, ehh, emm, ess; string starty = "20"+ lblSTDATE.Text.Substring(1, 2); string endy = "20"+lblTMDATE.Text.Substring(1, 2); sd = int.Parse(lblSTDATE.Text.Substring(5, 2)); sm = int.Parse(lblSTDATE.Text.Substring(3, 2)); ed = int.Parse(lblTMDATE.Text.Substring(5, 2)); em = int.Parse(lblTMDATE.Text.Substring(3, 2)); shh = 0; smm = 0; sss = 0; ehh = 0; emm = 0; ess= 0; #region [Save To Database] Event eventdata = new Event(); eventdata.eventName = lblPLT.Text; eventdata.startDay = sd.ToString(); eventdata.startMonth = sm.ToString(); eventdata.startYear = starty; eventdata.startHour = shh.ToString(); eventdata.startMin = smm.ToString(); eventdata.endDay = ed.ToString(); eventdata.endMonth = em.ToString(); eventdata.endYear = endy; eventdata.endHour = ehh.ToString(); eventdata.endMin = emm.ToString(); eventdata.otherInfo = ""; eventdata.backgroundColor = "#333333"; eventdata.foregroundColor = "#ffffff"; EventBLL oEventBLL = new EventBLL(); int r= oEventBLL.InsertEvents(eventdata); #region [File Data] if (r > 0) { eventdata.eventID = r; eventdata.PLT = lblPLT.Text; eventdata.DEPT = lblDEPT.Text; eventdata.MACH = lblMACH.Text; eventdata.YEARX = lblYEARX.Text; eventdata.NUMX = lblNUMX.Text; eventdata.UPC = lblUPC.Text; eventdata.PDTNM = lblPDTNM.Text; eventdata.PPDT3 = lblPPDT3.Text; eventdata.PPDT4 = lblPPDT4.Text; eventdata.PPDT5 = lblPPDT5.Text; eventdata.ORDER = lblORDER.Text; eventdata.RO = lblRO.Text; eventdata.REPQTY = lblREPQTY.Text; eventdata.SCHQTY = lblSCHQTY.Text; eventdata.DLVQTY = lblDLVQTY.Text; eventdata.AVGQTY = lblAVGQTY.Text; eventdata.STDATE = lblSTDATE.Text; eventdata.TMDATE = lblTMDATE.Text; eventdata.DLDATE = lblDLDATE.Text; eventdata.LWDATE = lblLWDATE.Text; eventdata.ENDATE = lblENDATE.Text; eventdata.MCHTYP = lblMCHTYP.Text; eventdata.SRMK1 = lblSRMK1.Text; eventdata.SRMK2 = lblSRMK2.Text; eventdata.SRMK3 = lblSRMK3.Text; eventdata.SRMK4 = lblSRMK4.Text; eventdata.SRMK5 = lblSRMK5.Text; eventdata.EOQ = lblEOQ.Text; eventdata.ROP = lblROP.Text; eventdata.TOTBK = lblTOTBK.Text; eventdata.ACTAL = lblACTAL.Text; eventdata.AVGSHP = lblAVGSHP.Text; eventdata.INST1 = lblINST1.Text; eventdata.INST2 = lblINST2.Text; eventdata.INST3 = lblINST3.Text; eventdata.SEQ = lblSEQ.Text; eventdata.CTRMID = lblCTRMID.Text; eventdata.CUSRID = lblCUSRID.Text; eventdata.CCHGDT = lblCCHGDT.Text; eventdata.CCHGTM = lblCCHGTM.Text; eventdata.CSTS = lblCSTS.Text; oEventBLL = new EventBLL(); r = oEventBLL.InsertFile(eventdata); } #endregion #endregion } } ClearResult(); } catch(Exception ex) { } }
public static Event[] ViewEvents() { DataTable dt = new DataTable(); List<Event> details = new List<Event>(); EventBLL oEventBLL = new EventBLL(); dt = oEventBLL.GetEvents(); foreach (DataRow dtrow in dt.Rows) { Event eve = new Event(); eve.eventID = Int32.Parse(dtrow["eventID"].ToString()); eve.eventName = dtrow["eventName"].ToString(); eve.startYear = dtrow["starYear"].ToString(); eve.startMonth = dtrow["startMonth"].ToString(); eve.startDay = dtrow["startDay"].ToString(); eve.startHour = dtrow["startHour"].ToString(); eve.startMin = dtrow["startMin"].ToString(); eve.endYear = dtrow["endYear"].ToString(); eve.endMonth = dtrow["endMonth"].ToString(); eve.endDay = dtrow["endDay"].ToString(); eve.endHour = dtrow["endHour"].ToString(); eve.endMin = dtrow["endMin"].ToString(); eve.otherInfo = dtrow["otherInfo"].ToString(); eve.backgroundColor = dtrow["backgroundColor"].ToString(); eve.foregroundColor = dtrow["foregroundColor"].ToString(); details.Add(eve); } return details.ToArray(); }