protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { DataView dv = new DataView(BindGvCustDetail().Table); Session["data"] = dv; grdCustDetails.DataSource = dv; grdCustDetails.DataBind(); DdlSection.Enabled = false; DdlSection.DataSource = SectionMaster.Get_SectionList(); DdlSection.DataBind(); repAlfabets.DataSource = Customer_cs.GetAlphabets(); repAlfabets.DataBind(); LblCustId.Text = "0"; fillzones(); TxtCustCode.Focus(); custRating(); getDDLdata(); getDDLarezo(); getDDLarea(); SetView(); //dv = (DataView)Session["data"]; ////string val = ((LinkButton)(sender)).Text; //dv.RowFilter = "CustName='A'"; //grdCustDetails.DataSource = dv; //grdCustDetails.DataBind(); //((LinkButton)(sender)).BackColor = System.Drawing.Color.Red; //((LinkButton)(sender)).ForeColor = System.Drawing.Color.White; } }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { string result = ""; if (value is int) { int dest_id = (int)value; DestMaster dest = BaseModel.GetFirst <DestMaster>(GetDBAccess().Conn, "SELECT * FROM dest_master WHERE dest_id=" + dest_id); if (dest != null) { string localeCode = CommonUtil.GetAppLocaleCode(); // 搬送行先立寄り部署から部署名をカンマ区切りで取得 result = GetValue <string>(SectionMaster.SelectNamesSql(localeCode, dest.dest_stop_sects), "value"); if (dest.dest_round_flg != 0) { result = result + "(" + Properties.Resources.PATROL + ")"; } } } return(result); }
public JsonResult Create(SectionMaster section) { try { string query = @"insert into SectionMaster (Section_Name,Section_Description,User_Id,Category_Id) values ('" + section.SectionName + "','" + section.SectionDescription + "','" + section.Id + "','" + section.CategoryId + "')"; DataTable table = new DataTable(); string sqlDataSource = configuration.GetConnectionString("DataConnection"); SqlDataReader dataReader; using (SqlConnection connection = new SqlConnection(sqlDataSource)) { connection.Open(); using (SqlCommand command = new SqlCommand(query, connection)) { dataReader = command.ExecuteReader(); table.Load(dataReader); dataReader.Close(); connection.Close(); } } return(new JsonResult("Data Inserted")); } catch { return(new JsonResult("Unauthorized user")); } }
public int DeleteSectionMasterdataToDB(SectionMaster r) { int n = 0; SqlConnection connectn = null; string con = "Data Source=AJAY;Initial Catalog=LMS;Integrated Security=True"; try { connectn = new SqlConnection(con); SqlCommand cmd = new SqlCommand("spDeleteSectionMasterDetails", connectn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Sec_Id", r.sectionId); connectn.Open(); n = cmd.ExecuteNonQuery(); n = n > 0 ? 1 : 0; } catch (Exception ex) { } finally { connectn.Close(); } return(n); }
// GET: ProductMasterController/Edit/5 public ActionResult Edit(SectionMaster section) { try { string query = @"Update SectionMaster set Section_Name ='" + section.SectionName + "', Section_Description = '" + section.SectionDescription + "',User_Id = '" + section.Id + "', Category_Id = '" + section.CategoryId + "' where Section_Id = " + section.SectionId; DataTable table = new DataTable(); string sqlDataSource = configuration.GetConnectionString("DataConnection"); SqlDataReader dataReader; using (SqlConnection connection = new SqlConnection(sqlDataSource)) { connection.Open(); using (SqlCommand command = new SqlCommand(query, connection)) { dataReader = command.ExecuteReader(); table.Load(dataReader); dataReader.Close(); connection.Close(); } } return(new JsonResult("Data Updated")); } catch (Exception e) { return(new JsonResult(e.Message)); } }
public void UpdateSectionMasterDetails() { try { SectionMaster s = new SectionMaster(); s.sectionId = Convert.ToInt32(txtSectionId.Text); s.sectionName = txtSectionName.Text; if (cmbStatus.SelectedItem == "Active") { s.sectionStatus = 0; } else { s.sectionStatus = 1; } SectioMasterBL bl = new SectioMasterBL(); int n = bl.UpdateSectiondata(s); MessageBox.Show("Record is Updated..."); } catch (Exception ex) { MessageBox.Show("Records are not Saved...Please Try Again"); } finally { //DisableControls(this); } }
public ActionResult DeleteConfirmed(int id) { SectionMaster sectionMaster = db.SectionMasters.Find(id); db.SectionMasters.Remove(sectionMaster); db.SaveChanges(); return(RedirectToAction("Index")); }
public DataView BindGvSectionDetail() { DataTable dt = new DataTable(); dt = SectionMaster.Get_SectionList(); DataView dv = new DataView(dt); return(dv); }
public ActionResult Edit([Bind(Include = "SectionId,SectionName,CreatedDate,IsDeleted")] SectionMaster sectionMaster) { if (ModelState.IsValid) { db.Entry(sectionMaster).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(sectionMaster)); }
public StationMasterDialog() { InitializeComponent(); string localeCode = CommonUtil.GetAppLocaleCode(); InitCombo(SectionMaster.SelectIdAndNameSql(localeCode), this.station_section_id); Reload <StationMaster>(this.comboNames); }
public AbsenceHistory() { InitializeComponent(); string localeCode = CommonUtil.GetAppLocaleCode(); // コンボボックスの初期化 InitCombo(SectionMaster.SelectIdAndNameSql(localeCode), this.comboReqSect); // 検索条件を初期化 InitCondition(); }
public CartMasterDialog() { InitializeComponent(); string localeCode = CommonUtil.GetAppLocaleCode(); InitCombo(SectionMaster.SelectIdAndNameSql(localeCode), this.cart_section_id, true, Properties.Resources.NOTHING); Reload <CartMaster>(this.comboNames); }
public SectionMasterDialog() { InitializeComponent(); string localeCode = CommonUtil.GetAppLocaleCode(); InitCombo(HospitalMaster.SelectIdAndNameSql(localeCode), this.section_hospital_id); InitCombo(SectionMaster.SelectIdAndNameSql(localeCode), this.section_forward_sect); Reload <SectionMaster>(this.comboNames); }
private void UpdateData() { if (this.comboNames.SelectedValue != null) { int id = GetComboSelectedValueAsInt(comboNames); SectionMaster row = BaseMasterModel.Find <SectionMaster>(this.m_db.Conn, id); SetData(row); } }
public ActionResult Create([Bind(Include = "SectionId,SectionName,CreatedDate,IsDeleted")] SectionMaster sectionMaster) { if (ModelState.IsValid) { db.SectionMasters.Add(sectionMaster); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(sectionMaster)); }
public CancelHistory() { InitializeComponent(); string localeCode = CommonUtil.GetAppLocaleCode(); // コンボボックスの初期化 InitCombo(SectionMaster.SelectIdAndNameSql(localeCode), this.comboReqSect); InitCombo(SectionMaster.SelectIdAndNameSql(localeCode), this.comboToSect); InitCombo(MuMaster.SelectIdAndNameSql(localeCode) + " ORDER BY mu_id", this.comboMu); InitCombo(CartMaster.SelectIdAndNameSql(localeCode), this.comboCart); // 検索条件を初期化 InitCondition(); }
// GET: SectionMasters/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SectionMaster sectionMaster = db.SectionMasters.Find(id); if (sectionMaster == null) { return(HttpNotFound()); } return(View(sectionMaster)); }
public void SaveSectionDetails() { SectionMaster section = new SectionMaster(); section.sectionId = Convert.ToInt32(txtSectionId.Text); section.sectionName = txtSectionName.Text; section.sectionStatus = cmbStatus.SelectedIndex; SectioMasterBL s = new SectioMasterBL(); s.SaveSectionMasterdata(section); MessageBox.Show("Record is Saved", "Message", MessageBoxButtons.OK); ClearControls(); }
public int SaveSectionMasterdata(SectionMaster s) { int n = 0; try { ISectionMasterDA objSec = new SectionMasterDA(); n = Convert.ToInt32(objSec.SaveSectionMasterdataToDB(s)); } catch (Exception ex) { } return(n); }
private void SetData(SectionMaster row) { bool isNew = false; if (row.section_id != 0) { // 更新のとき 変更不可 this.section_id.IsEnabled = false; // 削除を有効に this.deleteButton.IsEnabled = true; this.section_id.Text = row.section_id.ToString(); } else { // 新規のとき isNew = true; // 変更可 this.section_id.IsEnabled = true; // 削除を無効に this.deleteButton.IsEnabled = false; this.section_id.Text = ""; } this.section_name_en.Text = row.section_name_en; this.section_name_jp.Text = row.section_name_jp; this.section_name_cn.Text = row.section_name_cn; this.section_hospital_id.SelectedValue = row.section_hospital_id; this.section_floor_id.SelectedValue = row.section_floor_id; this.section_type.Text = row.section_type; SelectTextBoxNumber(this.section_entry_wait_point, row.section_entry_wait_point, isNew); SelectTextBoxNumber(this.section_combined_trans_flg, row.section_combined_trans_flg, isNew); SelectTextBoxNumber(this.section_recv_type, row.section_recv_type, isNew); this.section_recv_stack_list.Text = row.section_recv_stack_list; SelectComboByTag(this.section_absence_flg, row.section_absence_flg); this.section_forward_sect.SelectedValue = row.section_forward_sect; }
public int DeleteSectionData(SectionMaster s) { int n = 0; try { ISectionMasterDA objSection = new SectionMasterDA(); n = Convert.ToInt32(objSection.DeleteSectionMasterdataToDB(s)); } catch (Exception ex) { } finally { } return(n); }
/// <summary> /// オーダーIDから発部署に変換 /// </summary> /// <param name="value"></param> /// <param name="targetType"></param> /// <param name="parameter"></param> /// <param name="culture"></param> /// <returns></returns> public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { int order_id; string result_value = ""; if (this.GetInt(value, out order_id)) { // order_status_logのorder_log_idの一致する行でorder_log_datetimeが最新の行が対象 OrderStatusLog order_status_log = GetOrderStatusLog(order_id); if (order_status_log != null) { string localeCode = CommonUtil.GetAppLocaleCode(); // 部署ID一覧から部署名をカンマ区切りで取得 result_value = GetValue <string>(SectionMaster.SelectNamesSql(localeCode, order_status_log.order_log_from_sect.ToString()), "value"); } } return(result_value); }
public void DeleteSectionMasterDetails() { try { SectionMaster objSec = new SectionMaster(); objSec.sectionId = Convert.ToInt32(txtSectionId.Text); SectioMasterBL bl = new SectioMasterBL(); int n = bl.DeleteSectionData(objSec); MessageBox.Show("Record is Deleted..."); } catch (Exception ex) { MessageBox.Show("Records are not Saved...Please Try Again"); } finally { DisableControls(this); } }
protected void grdSectionMasterDetails_RowDeleting(object sender, GridViewDeleteEventArgs e) { SectionMaster _objSM = new SectionMaster(); _objSM.SectionID = Convert.ToInt32(((Label)grdSectionMasterDetails.Rows[e.RowIndex].FindControl("lblSectionID")).Text); _objSM.Sectioncode = ((Label)grdSectionMasterDetails.Rows[e.RowIndex].FindControl("lblSectioncode")).Text; _objSM.SectionName = ((Label)grdSectionMasterDetails.Rows[e.RowIndex].FindControl("lblSectionName")).Text; _objSM.IsActive = Convert.ToBoolean(false); _objSM.IsDeleted = Convert.ToBoolean(true); try { _objSM.Save(); MessageBox("Your record is Deleted"); grdSectionMasterDetails.DataSource = BindGvSectionDetail(); grdSectionMasterDetails.DataBind(); pnlSectionMasterDetails.Visible = true; PnlAddSection.Visible = false; } catch { } }
protected void btnSave_Click(object sender, EventArgs e) { SectionMaster _objSM = new SectionMaster(); _objSM.SectionID = Convert.ToInt32(lblID.Text); _objSM.Sectioncode = TxtSectionCode.Text.Trim(); _objSM.SectionName = TxtSectionName.Text.Trim(); _objSM.IsActive = true; _objSM.IsDeleted = false; _objSM.CreatedBy = "Admin"; try { _objSM.Save(); MessageBox("Record saved successfully"); grdSectionMasterDetails.DataSource = BindGvSectionDetail(); grdSectionMasterDetails.DataBind(); pnlSectionMasterDetails.Visible = true; PnlAddSection.Visible = false; } catch { } }
protected override void SetID(object t_row, int id) { SectionMaster row = (SectionMaster)t_row; row.section_id = id; }
public int AddSection(SectionMaster _master, string Otype) { DALCommon dal = new DALCommon(ConStr); return(dal.AddSection(_master, Otype)); }
protected void Page_Load(object sender, EventArgs e) { if (ChkBlacklist.Checked == true) { lblblkremark.Visible = true; LblblkDate.Visible = true; TxtblkRemark.Visible = true; TxtblkDate.Visible = true; } else { lblblkremark.Visible = false; LblblkDate.Visible = false; TxtblkRemark.Visible = false; TxtblkDate.Visible = false; } if (Session["ChetanaCompanyName"] != "" || Session["ChetanaCompanyName"] != null) { if (Session["FY"] != "" || Session["FY"] != null) { strChetanaCompanyName = Session["ChetanaCompanyName"].ToString(); strFY = Session["FY"].ToString(); } else { Session.Clear(); } } if (!Page.IsPostBack) { btnAddAccess.Enabled = false; txtBookType.Enabled = false; txtFromQty.Enabled = false; txtToQty.Enabled = false; txtDiscount.Enabled = false; DdlSection.Enabled = false; DdlSection.DataSource = SectionMaster.Get_SectionList(); DdlSection.DataBind(); repAlfabets.DataSource = Customer_cs.GetAlphabets(); repAlfabets.DataBind(); LblCustId.Text = "0"; fillzones(); custRating(); getDDLdata(); getDDLarezo(); getDDLarea(); GetSBUCode(); Session["saved"] = null; Session["TempDataTable"] = null; Session["TempAssorted"] = null; checkAction.Checked = true; SetView(); TxtCustCode.Focus(); if (ChkBlacklist.Checked == true) { lblblkremark.Visible = true; LblblkDate.Visible = true; TxtblkRemark.Visible = true; TxtblkDate.Visible = true; } else { lblblkremark.Visible = false; LblblkDate.Visible = false; TxtblkRemark.Visible = false; TxtblkDate.Visible = false; } } }
/// <summary> /// 部署ID一覧から部署名一覧を取得 /// </summary> /// <param name="ids"></param> /// <returns></returns> protected string GetSectionNames(string ids) { return(SectionMaster.GetSectionNames(GetDBAccess().Conn, ids)); }
/// <summary> /// 登録または更新ようにコントロールの値を行にを設定 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="row"></param> /// <param name="id"></param> protected override bool SetRowData(object t_row, int id) { SectionMaster row = (SectionMaster)t_row; bool bRet = true; row.section_id = id; row.section_name_en = this.section_name_en.Text; row.section_name_jp = this.section_name_jp.Text; row.section_name_cn = this.section_name_cn.Text; row.section_hospital_id = (Int16)GetComboSelectedValueAsInt(this.section_hospital_id); row.section_floor_id = (Int16)GetComboSelectedValueAsInt(this.section_floor_id); row.section_type = this.section_type.Text; int section_entry_wait_point; if (IsValidInt(this.section_entry_wait_point.Text, Properties.Resources.SECTION_ENTRY_WAIT_POINT, out section_entry_wait_point)) { row.section_entry_wait_point = section_entry_wait_point; } else { bRet = false; } int section_combined_trans_flg; if (IsValidInt(this.section_combined_trans_flg.Text, Properties.Resources.SECTION_COMBINED_TRANS_FLG, out section_combined_trans_flg)) { row.section_combined_trans_flg = (Int16)section_combined_trans_flg; } else { bRet = false; } int section_recv_type; if (IsValidInt(this.section_recv_type.Text, Properties.Resources.SECTION_RECV_TYPE, out section_recv_type)) { row.section_recv_type = (Int16)section_recv_type; } else { bRet = false; } row.section_recv_stack_list = this.section_recv_stack_list.Text; /* * int section_absence_flg; * if (IsValidInt(this.section_absence_flg.Text, Properties.Resources.SECTION_ABSENCE_FLG, out section_absence_flg)) * { * row.section_absence_flg = (Int16)section_absence_flg; * } * else * { * bRet = false; * } */ row.section_absence_flg = (Int16)GetComboSelectedTagValue(this.section_absence_flg, 0); row.section_forward_sect = GetComboSelectedValueAsInt(this.section_forward_sect); return(bRet); }