BKI_DichVuMatDat.US.US_GD_HOP_DONG.lap_hop_dong_moi_cho_nhan_vien C# (CSharp) Method

lap_hop_dong_moi_cho_nhan_vien() public method

public lap_hop_dong_moi_cho_nhan_vien ( decimal ID_NHAN_VIEN, decimal ID_LOAI_HOP_DONG, string MA_HOP_DONG, System.DateTime NGAY_BAT_DAU, System.DateTime NGAY_KET_THUC, System.DateTime NGAY_KY_HOP_DONG, System.DateTime NGAY_LAP, string NGUOI_LAP, string DA_XOA, decimal ID_CD_LCD, decimal ID_MUC_LCD, decimal ID_CD_LNS, decimal ID_MUC_LNS, string &op_str_mess ) : void
ID_NHAN_VIEN decimal
ID_LOAI_HOP_DONG decimal
MA_HOP_DONG string
NGAY_BAT_DAU System.DateTime
NGAY_KET_THUC System.DateTime
NGAY_KY_HOP_DONG System.DateTime
NGAY_LAP System.DateTime
NGUOI_LAP string
DA_XOA string
ID_CD_LCD decimal
ID_MUC_LCD decimal
ID_CD_LNS decimal
ID_MUC_LNS decimal
op_str_mess string
return void
        public void lap_hop_dong_moi_cho_nhan_vien(decimal ID_NHAN_VIEN
            , decimal ID_LOAI_HOP_DONG
            , string MA_HOP_DONG
            , DateTime NGAY_BAT_DAU
            , DateTime NGAY_KET_THUC
            , DateTime NGAY_KY_HOP_DONG
            , DateTime NGAY_LAP
            , string NGUOI_LAP
            , string DA_XOA
            , decimal ID_CD_LCD
            , decimal ID_MUC_LCD
            , decimal ID_CD_LNS
            , decimal ID_MUC_LNS
            , ref string op_str_mess)
        {
            CStoredProc v_sp = new CStoredProc("pr_lap_hop_dong_moi_cho_nhan_vien");
            v_sp.addDecimalInputParam("@ID_NHAN_VIEN", ID_NHAN_VIEN);
            v_sp.addDecimalInputParam("@ID_LOAI_HOP_DONG", ID_LOAI_HOP_DONG);
            v_sp.addNVarcharInputParam("@MA_HOP_DONG", MA_HOP_DONG);
            v_sp.addDatetimeInputParam("@NGAY_BAT_DAU", NGAY_BAT_DAU);
            v_sp.addDatetimeInputParam("@NGAY_KET_THUC", NGAY_KET_THUC);
            v_sp.addDatetimeInputParam("@NGAY_KY_HOP_DONG", NGAY_KY_HOP_DONG);
            v_sp.addDatetimeInputParam("@NGAY_LAP", NGAY_LAP);
            v_sp.addNVarcharInputParam("@NGUOI_LAP", NGUOI_LAP);
            v_sp.addNVarcharInputParam("@DA_XOA", DA_XOA);
            v_sp.addDecimalInputParam("@ID_CD_LCD", ID_CD_LCD);
            v_sp.addDecimalInputParam("@ID_MUC_LCD", ID_MUC_LCD);
            v_sp.addDecimalInputParam("@ID_CD_LNS", ID_CD_LNS);
            v_sp.addDecimalInputParam("@ID_MUC_LNS", ID_MUC_LNS);
            SqlParameter v_op_str = v_sp.addNVarcharOutputParam("@OP_STR_MESSAGE", op_str_mess);
            v_sp.ExecuteCommand(this);
            op_str_mess = v_op_str.Value.ToString();
        }

Usage Example

        private void save_data()
        {
            US_GD_HS_LNS_LCD v_us_gd_hs_lns_lcd = new US_GD_HS_LNS_LCD();
            US_GD_HE_SO_LNS v_us_gd_hs_lns = new US_GD_HE_SO_LNS();
            US_GD_LUONG_CHE_DO v_us_gd_lcd = new US_GD_LUONG_CHE_DO();
            US_GD_TRANG_THAI_LAO_DONG v_us_gd_trang_thai_lao_dong = new US_GD_TRANG_THAI_LAO_DONG();
            US_GD_HOP_DONG v_us_gd_hd = new US_GD_HOP_DONG();
            form_2_us_gd_hop_dong(v_us_gd_hd);
            US_GD_HOP_DONG v_us = new US_GD_HOP_DONG();
            switch (m_e_form_mode)
            {
                case DataEntryFormMode.UpdateDataState:
                    v_us_gd_hd.BeginTransaction();
                    v_us_gd_hd.dcID = CIPConvert.ToDecimal(m_grv_lap_hd.GetRowCellValue(m_grv_lap_hd.FocusedRowHandle, "ID"));
                    v_us_gd_hd.Update();
                    v_us_gd_hd.CommitTransaction();

                    //
                    form_2_us_gd_hs_lns_lcd(v_us_gd_hs_lns_lcd);
                    v_us_gd_hs_lns_lcd.BeginTransaction();
                    v_us_gd_hs_lns_lcd.dcID = find_id_gd_lns_lcd(CIPConvert.ToDecimal(m_grv_lap_hd.GetRowCellValue(m_grv_lap_hd.FocusedRowHandle, "ID")));
                    v_us_gd_hs_lns_lcd.Update();
                    v_us_gd_hs_lns_lcd.CommitTransaction();
                    break;
                case DataEntryFormMode.InsertDataState:
                    v_us.lap_hop_dong_moi_cho_nhan_vien(CIPConvert.ToDecimal(m_sle_chon_nhan_vien.EditValue)
                                                        , CIPConvert.ToDecimal(m_sle_loai_hop_dong.EditValue)
                                                        , m_txt_ma_hd.Text.Trim()
                                                        , m_dat_ngay_bat_dau.Value.Date
                                                        , m_dat_ngay_ket_thuc.Value.Date
                                                        , m_dat_ngay_ky.Value.Date
                                                        , DateTime.Now.Date
                                                        , CAppContext_201.getCurrentUserName()
                                                        , "N"
                                                        , CIPConvert.ToDecimal(m_sle_chuc_danh_lcd.EditValue)
                                                        , CIPConvert.ToDecimal(m_sle_muc_lcd.EditValue)
                                                        , CIPConvert.ToDecimal(m_sle_chuc_danh_lns.EditValue)
                                                        , CIPConvert.ToDecimal(m_sle_muc_lns.EditValue)
                                                        , ref op_str_mess);
                    break;
                case DataEntryFormMode.ViewDataState:
                    break;
                case DataEntryFormMode.SelectDataState:
                    break;
                default:
                    break;
            }

            //US_GD_HS_LNS_LCD v_us_gd_hs_lns_lcd = new US_GD_HS_LNS_LCD();
            //US_GD_HE_SO_LNS v_us_gd_hs_lns = new US_GD_HE_SO_LNS();
            //US_GD_LUONG_CHE_DO v_us_gd_lcd = new US_GD_LUONG_CHE_DO();
            //US_GD_TRANG_THAI_LAO_DONG v_us_gd_trang_thai_lao_dong = new US_GD_TRANG_THAI_LAO_DONG();
            //US_GD_HOP_DONG v_us_gd_hd = new US_GD_HOP_DONG();
            //form_2_us_gd_hop_dong(v_us_gd_hd);
            //try
            //{
            //    switch (m_e_form_mode)
            //    {
            //        case DataEntryFormMode.InsertDataState:
            //            if (m_id_gd_hd != -1)
            //            {
            //                cho_hop_dong_da_co_ve_trang_thai_delete_Y();
            //                cho_gd_hs_lns_lcd_da_xoa_Y();
            //                cho_gd_hs_lns_da_xoa_Y();
            //                cho_gd_lcd_da_xoa_Y();
            //            }

            //            //lap hop dong moi
            //            v_us_gd_hd.BeginTransaction();
            //            v_us_gd_hd.Insert();
            //            v_us_gd_hd.CommitTransaction();

            //            //insert gd_hs_lns_lcd
            //            form_2_us_gd_hs_lns_lcd(v_us_gd_hs_lns_lcd);
            //            v_us_gd_hs_lns_lcd.BeginTransaction();
            //            v_us_gd_hs_lns_lcd.Insert();
            //            v_us_gd_hs_lns_lcd.CommitTransaction();

            //            //insert gd_hs_lns
            //            form_2_us_gd_hs_lns(v_us_gd_hs_lns);
            //            v_us_gd_hs_lns.BeginTransaction();
            //            v_us_gd_hs_lns.Insert();
            //            v_us_gd_hs_lns.CommitTransaction();

            //            //insert gd_lcd
            //            form_2_us_gd_lcd(v_us_gd_lcd);
            //            v_us_gd_lcd.BeginTransaction();
            //            v_us_gd_lcd.Insert();
            //            v_us_gd_lcd.CommitTransaction();

            //            //insert gd_trang_thai_ld
            //            decimal v_id_gd_trang_thai_lao_dong_da_co = 0;

            //            v_id_gd_trang_thai_lao_dong_da_co = find_id_trang_thai_lao_dong_da_co(decimal.Parse(m_sle_chon_nhan_vien.EditValue.ToString())); //sai o day

            //            if (v_id_gd_trang_thai_lao_dong_da_co == -1)
            //            {
            //                form_2_us_gd_trang_thai_lao_dong(v_us_gd_trang_thai_lao_dong);
            //                v_us_gd_trang_thai_lao_dong.BeginTransaction();
            //                v_us_gd_trang_thai_lao_dong.Insert();
            //                v_us_gd_trang_thai_lao_dong.CommitTransaction();
            //            }
            //            break;
            //        case DataEntryFormMode.UpdateDataState:
            //            v_us_gd_hd.BeginTransaction();
            //            v_us_gd_hd.dcID = CIPConvert.ToDecimal(m_grv_lap_hd.GetRowCellValue(m_grv_lap_hd.FocusedRowHandle, "ID"));
            //            v_us_gd_hd.Update();
            //            v_us_gd_hd.CommitTransaction();

            //            //
            //            form_2_us_gd_hs_lns_lcd(v_us_gd_hs_lns_lcd);
            //            v_us_gd_hs_lns_lcd.BeginTransaction();
            //            v_us_gd_hs_lns_lcd.dcID = find_id_gd_lns_lcd(CIPConvert.ToDecimal(m_grv_lap_hd.GetRowCellValue(m_grv_lap_hd.FocusedRowHandle, "ID")));
            //            v_us_gd_hs_lns_lcd.Update();
            //            v_us_gd_hs_lns_lcd.CommitTransaction();
            //            break;
            //        default:
            //            break;
            //    }
            //}
            //catch (Exception v_e)
            //{

            //    throw v_e;
            //}
        }
All Usage Examples Of BKI_DichVuMatDat.US.US_GD_HOP_DONG::lap_hop_dong_moi_cho_nhan_vien