private void SearchLossRateMst() { List <ShopUserInfoDto> areaList = new List <ShopUserInfoDto>(); DataSet ds = local.ShopUserInfoSearch(CommonHandler.GetComboBoxSelectedValue(cboProjects).ToString(), btnShopCode.Text.Trim()); if (ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { ShopUserInfoDto area = new ShopUserInfoDto(); area.ProjectCode = Convert.ToString(ds.Tables[0].Rows[i]["ProjectCode"]); area.ShopCode = Convert.ToString(ds.Tables[0].Rows[i]["ShopCode"]); area.ShopName = Convert.ToString(ds.Tables[0].Rows[i]["ShopName"]); area.UserName = Convert.ToString(ds.Tables[0].Rows[i]["UserName"]); area.PinYinName = Convert.ToString(ds.Tables[0].Rows[i]["PinYinName"]); area.PostionCode = Convert.ToString(ds.Tables[0].Rows[i]["PositionCode"]); area.AuthCode = Convert.ToString(ds.Tables[0].Rows[i]["AuthCode"]); area.InUserId = Convert.ToString(ds.Tables[0].Rows[i]["InUserId"]); area.InDateTime = Convert.ToDateTime(ds.Tables[0].Rows[i]["InDateTime"]); area.PicNameList = Convert.ToString(ds.Tables[0].Rows[i]["PicNameList"]); area.AreaName = Convert.ToString(ds.Tables[0].Rows[i]["AreaName"]); areaList.Add(area); } } grcShop.DataSource = areaList; }
private void btnViewPic_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { ShopUserInfoDto shop = grvShop.GetRow(grvShop.FocusedRowHandle) as ShopUserInfoDto; AllPictureShow2 all = new AllPictureShow2(AppDomain.CurrentDomain.BaseDirectory + "UploadImage" + "\\" + shop.ProjectCode + shop.ShopName + "\\" + "考试人员类型登记", (shop.PicNameList != null ? shop.PicNameList : "").Split(';'), shop.ShopName); all.Show(); }
public override void AddRowButtonClick() { if (string.IsNullOrEmpty(btnShopCode.Text)) { CommonHandler.ShowMessage(MessageType.Information, "请选择经销商"); return; } ShopUserInfoDto shop = new ShopUserInfoDto(); shop.ProjectCode = CommonHandler.GetComboBoxSelectedValue(cboProjects).ToString(); shop.ShopCode = btnShopCode.Text; shop.ShopName = txtShopName.Text; dataHandler.AddRow(shop); }
private void grvShop_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e) { ShopUserInfoDto shop = grvShop.GetRow(grvShop.FocusedRowHandle) as ShopUserInfoDto; if (e.Column == gcAreaName || e.Column == gcShopCode || e.Column == gcShopName || e.Column == gridColumn4 || e.Column == gridColumn6) { e.Appearance.BackColor = CommonHandler.GetReadOnlyColor(); e.Appearance.ForeColor = Color.Black; } }
private void grcShop_DragDrop(object sender, DragEventArgs e) { GridHitInfo bdhi = grvShop.CalcHitInfo(new Point(e.X, e.Y)); bdhi = grvShop.CalcHitInfo(grcShop.PointToClient(new System.Drawing.Point(e.X, e.Y))); if (bdhi.InRow) { int rowHandle = bdhi.RowHandle; ShopUserInfoDto shopuser = grvShop.GetRow(rowHandle) as ShopUserInfoDto; if (shopuser.UserName == null) { CommonHandler.ShowMessage(MessageType.Information, "请先输入姓名"); return; } if (!Directory.Exists(AppDomain.CurrentDomain.BaseDirectory + "UploadImage" + "\\" + shopuser.ProjectCode + shopuser.ShopName + "\\" + "考试人员登记")) { Directory.CreateDirectory(AppDomain.CurrentDomain.BaseDirectory + "UploadImage" + "\\" + shopuser.ProjectCode + shopuser.ShopName + "\\" + "考试人员登记"); } String[] fileNames = (String[])e.Data.GetData(DataFormats.FileDrop); File.Copy(fileNames[0], AppDomain.CurrentDomain.BaseDirectory + "UploadImage" + "\\" + shopuser.ProjectCode + shopuser.ShopName + "\\" + "考试人员登记" + "\\" + shopuser.UserName + ".jpg"); string fileNamesString = String.Empty; string fileName = string.Empty; for (int i = 0; i < fileNames.Length; i++) { fileNamesString += fileNames[i]; fileName += shopuser.UserName; if (i != fileNames.Length - 1) { fileName += ";"; fileNamesString += ";"; } } grvShop.SetRowCellValue(rowHandle, gcPicNameList, fileName); // LossResultDto uploaddto = grvLoss.GetRow(rowHandle) as LossResultDto; // uploaddto.FileName = fileName; // grvLoss.SetRowCellValue(rowHandle, "PicName", uploaddto.FileName); // string[] filenameList = fileName.Split(';'); // for (int i = 0; i < filenameList.Length; i++) // { // //if (uploaddto.FilePath.Contains(':') && uploaddto.FilePath.Contains('\\')) // //{ // //uploaddto.FileName = txtShopName.Text + "_" + txtSubjectCode.Text + "_" + grvLoss.FocusedRowHandle.ToString(); // CommonHandler.CompressionPic(CommonHandler.GetComboBoxSelectedValue(cboProjects).ToString(), this.UserInfoDto.UserID, fileNames[i], filenameList[i], CommonHandler.GetComboBoxSelectedValue(cboProjects).ToString() + txtShopName.Text); // string appDomainPath = string.Empty; // appDomainPath = service.getImagePath(ProjectCode_Golbal, this.UserInfoDto.UserID); // if (string.IsNullOrEmpty(appDomainPath)) // { // appDomainPath = AppDomain.CurrentDomain.BaseDirectory; // } // string filePath = appDomainPath + @"\" + @"UploadImage\" + CommonHandler.GetComboBoxSelectedValue(cboProjects).ToString() + txtShopName.Text + @"\" + filenameList[i] + ".jpg"; // byte[] image = null; // if (File.Exists(filePath)) // { // FileStream fs = new FileStream(filePath, FileMode.Open); // int streamLength = (int)fs.Length; // image = new byte[streamLength]; // fs.Read(image, 0, streamLength); // fs.Close(); // } // else // { // image = new byte[0]; // } // service.SaveAnswerDtl2Streampic(base.UserInfoDto.UserID, // image, CommonHandler.GetComboBoxSelectedValue(cboProjects).ToString() + txtShopName.Text, // filenameList[i], "", "", SubjectCode_Golbal); // //} // //GetFileAndPic(); } CommonHandler.ShowMessage(MessageType.Information, "图片上传成功!"); }